package wiktionary.to.xml.full.jpa;

// Generated Oct 28, 2013 11:11:01 AM by Hibernate Tools 3.4.0.CR1

import java.util.LinkedHashSet;
import java.util.Set;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;

import static javax.persistence.GenerationType.IDENTITY;

import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 * WordEtym generated by hbm2java
 */
@Entity
@Table(name = "wordetym")
public class WordEtym implements java.io.Serializable {
	private static final long serialVersionUID = 1L;
	
    private Integer id;
    private WordLang wordLang;
    private String dataField;
    private Set<WordEntry> wordEntries = new LinkedHashSet<WordEntry>(0);
    private Set<Etym> etyms = new LinkedHashSet<Etym>(0);

    public WordEtym() {
    }

    public WordEtym(WordLang wordLang) {
        this.wordLang = wordLang;
    }

    public WordEtym(WordLang wordLang, String dataField,
            Set<WordEntry> wordEntries, Set<Etym> etyms) {
        this.wordLang = wordLang;
        this.dataField = dataField;
        this.wordEntries = wordEntries;
        this.etyms = etyms;
    }

    @Id
    @GeneratedValue(strategy = IDENTITY)
    @Column(name = "id", unique = true, nullable = false)
    public Integer getId() {
        return this.id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "wordlang_id", nullable = false)
    public WordLang getWordLang() {
        return this.wordLang;
    }

    public void setWordLang(WordLang wordLang) {
        this.wordLang = wordLang;
    }

    @Column(name = "dataField", length = 45)
    public String getDataField() {
        return this.dataField;
    }

    public void setDataField(String dataField) {
        this.dataField = dataField;
    }

    @OneToMany(fetch = FetchType.LAZY, mappedBy = "wordEtym")
    public Set<WordEntry> getWordEntries() {
        return this.wordEntries;
    }

    public void setWordEntries(Set<WordEntry> wordEntries) {
        this.wordEntries = wordEntries;
    }

    @OneToMany(fetch = FetchType.LAZY, mappedBy = "wordEtym")
    public Set<Etym> getEtyms() {
        return this.etyms;
    }

    public void setEtyms(Set<Etym> etyms) {
        this.etyms = etyms;
    }

}
